package com.wanger.swa.config.swTools;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.wanger.swa.dto.template.resp.tips.systemTool.SysToolInfo;
import com.wanger.swc.model.tips.TipInfo;
import lombok.Data;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: wanger
 * @Date: 2024/12/29 18:21
 * @Description:
 */
@Data
@Component
public class StrUtilResp implements SysToolInfo {

    @Override
    public Class<?> toolType() {
        return StrUtil.class;
    }

    @Override
    public TipInfo getTitle() {
        return new TipInfo("StrUtil", "字符串工具，参考hutool=>StrUtil");
    }

    @Override
    public List<TipInfo> getTips() {
        return CollUtil.toList(
                new TipInfo("StrUtil.toCamelCase(str)", "下划线转小驼峰"),
                new TipInfo("StrUtil.upperFirst(str)", "小驼峰转大驼峰"),
                new TipInfo("StrUtil.toUnderlineCase(str)", "转下划线"),
                new TipInfo("\"aB\".toLowerCase()", "转全小写"),
                new TipInfo("\"aB\".toUpperCase()", "转全大写"),
                new TipInfo("StrUtil.toSymbolCase(\"aB\", '.')", "驼峰使用指定字符分割"),
                new TipInfo("other", "其他功能参考hutool->StrUtil")
        );
    }
}
